#ifndef _PRINT_H
#define _PRINT_H

typedef unsigned char *va_list;
typedef int ( * fnptr_t ) ( unsigned c, void** helper );

#define va_start(AP, LASTARG) (AP = ((va_list) & (LASTARG) + va_size(LASTARG)))
#define va_size(TYPE) ((sizeof(TYPE) + sizeof(int) - 1) &~ (sizeof(int) - 1))
#define __va_rounded_size( TYPE ) (((sizeof (TYPE) + sizeof(int) - 1) / sizeof(int)) * sizeof(int))
#define va_arg( AP, TYPE ) (AP += __va_rounded_size (TYPE),  * ((TYPE*) (AP - __va_rounded_size(TYPE))))
#define va_end(AP)

// Printf Defines:
#define	PR_LJ		0x01
#define	PR_CA		0x02
#define	PR_SG		0x04
#define	PR_32		0x08
#define	PR_16		0x10
#define	PR_WS		0x20
#define	PR_LZ		0x40
#define	PR_FP		0x80
#define	PR_BUFLEN	16

#define	NULL	0

int printf(char *fmt, ...);
int print_hex(int);
int print_dec(int);
int print_ch(char);

#endif
